#pragma once
#include <iostream>


//产品类Meal(套餐类) 
class Meal{
public:
	//food和drink是部件 
	void setFood(std::string food){
		this->food = food;
	}
	void setDrink(std::string drink){
		this->drink = drink;
	}
	std::string getFood(){
		return food;
	}
	std::string getDrink(){
		return drink;
	}
private:
	std::string food;
	std::string drink;	
};


//抽象建造者类MealBuilder(套餐建造者类)
class MealBuilder{
public:
	virtual void buildFood()=0;
	virtual void buildDrink()=0;
	Meal getMeal(){
		return meal;
	}
protected:
	Meal meal;
}; 


//具体建造者类SubMealBuilderA(A套餐建造者类)
class SubMealBuilderA : public MealBuilder{
public:
	void buildFood(){
		meal.setFood("一个鸡腿堡");
	}
	void buildDrink(){
		meal.setDrink("一杯可乐");
	}
}; 


//具体建造者类SubMealBuilderB(B套餐建造者类)
class SubMealBuilderB : public MealBuilder{
public:
	void buildFood(){
		meal.setFood("一个鸡肉卷");
	}
	void buildDrink(){
		meal.setDrink("一杯果汁");
	}
}; 